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