UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xPx17CToSvjRvM5AluYq4Z8Pj/j//ZmpcGdBKMwHHg='
WHERE
key_id = 'e8ae39bf2fee608268e41880fc45ffbd0522ed8000e06c7b5e2721532cc2abb8'
AND (
token = '7xPx17CToSvjRvM5AluYq4Z8Pj/j//ZmpcGdBKMwHHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)