UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fq56LjztJQU1hIzNmOSVvR2yTTJiJS9L40nCW7ya400='
WHERE
key_id = '3e1989abe7c5773ff082d431e8351fd6b0f7fe9df0e06b6f034db7c20178c49d'
AND (
token = 'Fq56LjztJQU1hIzNmOSVvR2yTTJiJS9L40nCW7ya400='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)