UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HDfI3T7qhFwuy/xreAdlsSjA4w4r24du29CUekxWPyM='
WHERE
key_id = '85dd79efc9ee1fcd6f2d29ed4b883cd48f8d32053d131e3b34f505b6bd388266'
AND (
token = 'HDfI3T7qhFwuy/xreAdlsSjA4w4r24du29CUekxWPyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)