UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7UflLx9zkrwSRwQoh1e2eMfi5row0GKrv461BBvBg8s='
WHERE
key_id = 'f36d93b954c6f277afa8ab1344f7d4c3a15f9ceb2d6ea9bb586cf96971308e0a'
AND (
token = '7UflLx9zkrwSRwQoh1e2eMfi5row0GKrv461BBvBg8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)