UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zqpOMmKW5PRh7nTaxw1pgyh7xMDZAF+BcoZc+oa8bVU='
WHERE
key_id = 'ae911676836ea80c817ec9f07ba2cdd314c4d41f5495cd255a9e4e99b2029ff2'
AND (
token = 'zqpOMmKW5PRh7nTaxw1pgyh7xMDZAF+BcoZc+oa8bVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)