UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9vsIU4/Pm2L6ey7lDEgfQnPZfpEnYzKB/8jyPFIt0Bc='
WHERE
key_id = 'e21aa405516d4eaab9c925f5e08a0937d6e98c8d75cbd7cb83dbb072a4652340'
AND (
token = '9vsIU4/Pm2L6ey7lDEgfQnPZfpEnYzKB/8jyPFIt0Bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)