UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4qEFP3qWjVKmdhI8mpLZBEXg78+Jv3gwut5qfsR0XaQ='
WHERE
key_id = '7329d428443de737099a15c32405d9d670e112b2a75953541de8624a9606857e'
AND (
token = '4qEFP3qWjVKmdhI8mpLZBEXg78+Jv3gwut5qfsR0XaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)