UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KuhvdKw7Ftf1W3g4eZDvUe1uLLGh6t/EzmYsuOxV4c0='
WHERE
key_id = '1aa25c9d7926389162db9250df50e6ce60689ecd0c2b53a6bfa3c0360703b859'
AND (
token = 'KuhvdKw7Ftf1W3g4eZDvUe1uLLGh6t/EzmYsuOxV4c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)