UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ytq5wh085v8x6ipeqXRZzGxYtkIgEkDohlB+U6waB8='
WHERE
key_id = 'd9e3aad26600f5e123c94a8db35da93fc718aa25e8cf1fd9ec8095c05ed7b6cb'
AND (
token = '8ytq5wh085v8x6ipeqXRZzGxYtkIgEkDohlB+U6waB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)