UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ilvegGtZf/VM996UP10gqKxehrCMOWfq26RZGqHcst4='
WHERE
key_id = 'fc39770280903e8db3acc5730d17ebc462ef3f95a3d0cf4c88483a3967c2b9a8'
AND (
token = 'ilvegGtZf/VM996UP10gqKxehrCMOWfq26RZGqHcst4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)