UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jII4B+VRa/e3AGUCjH0ePh4DB4borVkQhLMxKPH2vVU=' 
WHERE 
  key_id = '3fce8bc9446452ae33c542af0b41dd85e2783ee203e50acba228c8b0ba4fe2a3' 
  AND (
    token = 'jII4B+VRa/e3AGUCjH0ePh4DB4borVkQhLMxKPH2vVU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038