UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ICg6hNaepX7ABkNS8h3E4lsaGo/BGULDmobf5yFqhCE='
WHERE
key_id = '1a32b5e847252dd12262a5cf5468cbd904fdb332d6294850b7428ffed388c350'
AND (
token = 'ICg6hNaepX7ABkNS8h3E4lsaGo/BGULDmobf5yFqhCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)