UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'insaqcf8a1ylO1RBt6UEro48frKKNj2gvU4AlT/6F9E='
WHERE
key_id = 'e4aeab739016d224bac449efdcfba4c2de111d8fab2c90f7b16aa4a7c94fd56d'
AND (
token = 'insaqcf8a1ylO1RBt6UEro48frKKNj2gvU4AlT/6F9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)