UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IpsEu7D+fFASHwqkkkuKu6YqPUUtrrUHUnTprfQBJV8='
WHERE
key_id = '0061d363b7ca0b1d445357e9abb78d067ca62bf6d0715eafe0cddda17893c9af'
AND (
token = 'IpsEu7D+fFASHwqkkkuKu6YqPUUtrrUHUnTprfQBJV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)