UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ypi+7TVQAAo1XCpzgEePtqSujD29iJbG+8bl9upgoUU='
WHERE
key_id = 'abb831d1fa4eef242ae7f2eb74d6b80f5bb8486384f79cbb6b521d28bc43be73'
AND (
token = 'Ypi+7TVQAAo1XCpzgEePtqSujD29iJbG+8bl9upgoUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)