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