UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8PI9Wzys+rl8WNM7fHWAy+/q4SGwFrKgtOTwWSoQXPE='
WHERE
key_id = '48fc7cb38221eb093e812ea6b7907b7c4d64a90e94be060ce91e2b7b71041791'
AND (
token = '8PI9Wzys+rl8WNM7fHWAy+/q4SGwFrKgtOTwWSoQXPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)