UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zv2wAUqet6xaTFSDHq4xCX3JxFIdj1DdHfafR88OWB8='
WHERE
key_id = '26b68d8f9db909c66d5d74515249928c442c5edae7b167da88aa5014df0faa30'
AND (
token = 'Zv2wAUqet6xaTFSDHq4xCX3JxFIdj1DdHfafR88OWB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)