UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26F7oLM99KMm+2hSLN8MW6aiG6KtNDOCWv5QhhLkcnA=' 
WHERE 
  key_id = '63ad58138c1f319ab339a5059b6a0b600363fa38ec0e688b8a49968eef143222' 
  AND (
    token = '26F7oLM99KMm+2hSLN8MW6aiG6KtNDOCWv5QhhLkcnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033