UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXQs38QV40wtOfAS0nxO35aUHtKapFRFjQg9FUHNR5g='
WHERE
key_id = '3044916f7bcd6a60817aa4ff67f195034c40a15e1c7d867640a08e22391c6757'
AND (
token = 'nXQs38QV40wtOfAS0nxO35aUHtKapFRFjQg9FUHNR5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)