UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wqj0002Ba5ZxCF/LrGfOa47V+nr/LLJ3FJoFx7WwyYg=' 
WHERE 
  key_id = 'c8af3e5f56dbbd50c99a453872f5d1e04456b9d70a9e8f4874a67b509f1b0c9e' 
  AND (
    token = 'wqj0002Ba5ZxCF/LrGfOa47V+nr/LLJ3FJoFx7WwyYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033