UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrZtsni+An5IC4iRZ3atvEZRJ3LVbFY1NEzSHuUnc/M='
WHERE
key_id = 'e5aa1fa43132b30ae6894aad20c0442d42daf8d0e821fa08ddaa7d084c96fd22'
AND (
token = 'CrZtsni+An5IC4iRZ3atvEZRJ3LVbFY1NEzSHuUnc/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)