UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z98SXgPHoAbhJJqkMhj0k/sNX5SUz4Pse5CiVOCOdRE=' 
WHERE 
  key_id = 'a8890fac00c0ed87f57678633bc14600feeb876655a2198bc985cbe9b2dad0f5' 
  AND (
    token = 'z98SXgPHoAbhJJqkMhj0k/sNX5SUz4Pse5CiVOCOdRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031