UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6pE4DnkMvFU6IFh9MWuOeROnmyZAcgM9Yz/swa6WJCk=' 
WHERE 
  key_id = 'ef909dc3e6795fc32c36a378206d321d2c55345f6bc352c07e122ebf98c5cac1' 
  AND (
    token = '6pE4DnkMvFU6IFh9MWuOeROnmyZAcgM9Yz/swa6WJCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042