UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7NNyGspZKcRD7FSCpOkHurwFNz6zJgJ7wrc5jKoAH80=' 
WHERE 
  key_id = '1f1bff262d198d36f36c370dc1a1b2f7127ed8f33ec20ffcc0c85185d59e70c0' 
  AND (
    token = '7NNyGspZKcRD7FSCpOkHurwFNz6zJgJ7wrc5jKoAH80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029