UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v780lhOWg3J0NLYbaBgfdtdDKHI3xJOaoF1oCfE/wjc='
WHERE
key_id = '3489d3dd225dadb2d40ed86f95be9667b65400b03c2b7653c6ba5f65f555cf02'
AND (
token = 'v780lhOWg3J0NLYbaBgfdtdDKHI3xJOaoF1oCfE/wjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)