UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '24k5xrAaSx0QBIkXdBO59b8YYhZ6Pu5lJQM6vmD0BKM='
WHERE
key_id = '009cf768203f4386d1aa8a857131a6515765baf7dd1b80137a312bf53f87c0e4'
AND (
token = '24k5xrAaSx0QBIkXdBO59b8YYhZ6Pu5lJQM6vmD0BKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)