UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MHV5eVlXOu5bij70MET3fo5z9H/PmHm8NPi2HEgON5I='
WHERE
key_id = '45d9b2d4dde68e5925a5cce86d9191c5e81cf440b697f7594d3342c240a830d8'
AND (
token = 'MHV5eVlXOu5bij70MET3fo5z9H/PmHm8NPi2HEgON5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)