UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '167SUTGZwqNW7C/sjv6qGd7OKkA2iGMtgp9Nu7mfKCk=' 
WHERE 
  key_id = 'b48d1ce8b88c57c01182fa53191f9ba219ad4ee9c69bf1645aa8a8fe977461a5' 
  AND (
    token = '167SUTGZwqNW7C/sjv6qGd7OKkA2iGMtgp9Nu7mfKCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030