UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 're6pesIjPPd8R4rPfdd5SYGKpmSlDdIHvJGh2VnVCWo='
WHERE
key_id = 'f9e402b1fdce802be3ae02a3cef87835bde3ea5656eb0155941d3223341bbb73'
AND (
token = 're6pesIjPPd8R4rPfdd5SYGKpmSlDdIHvJGh2VnVCWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)