UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dWDfcAUF1lLf4wYN/llm02As5TuyLAxj3PqTH1YggE='
WHERE
key_id = '2189f7d8a89d0f253ccde041c610302be05309e2522fa738a07e0a4bda28bc9d'
AND (
token = '5dWDfcAUF1lLf4wYN/llm02As5TuyLAxj3PqTH1YggE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)