UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94JrEPXbWKDp/TcwxqCoyAoxusGhcfe6qH6NaNUTiaE='
WHERE
key_id = '1557346f8c5714db6f0b008eb97bf9ab9a4850474b635130d99409ad3f12dd36'
AND (
token = '94JrEPXbWKDp/TcwxqCoyAoxusGhcfe6qH6NaNUTiaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)