UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tKqXo8dWM0LuuSML9HQdTz7o3Kfg50hbYihpqa1phPo='
WHERE
key_id = '09044e73fcd4a3458edf6b885fc240bc7b6a172374465b27440e8fd05d31ac9b'
AND (
token = 'tKqXo8dWM0LuuSML9HQdTz7o3Kfg50hbYihpqa1phPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)