UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ILVWCj+r9KZE+W7iF8JoLhnr7v91O4zPFs9k14bSqg='
WHERE
key_id = '72fee3a873f009851ce517ea76b1dcb3416dfa118b407be35983ef4a59f75fb4'
AND (
token = '9ILVWCj+r9KZE+W7iF8JoLhnr7v91O4zPFs9k14bSqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)