UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'feZ8aPPH/uXJ3DxJ7Gd0eiXCFLnwp8QhPwKWiYFfQWo='
WHERE
key_id = '4f4c722dd4933968df04b147da9b0d199ad9b6cded602ad329daaf081074c775'
AND (
token = 'feZ8aPPH/uXJ3DxJ7Gd0eiXCFLnwp8QhPwKWiYFfQWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)