UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GFFuFAvOwAHFpu9phSM51Jqld4uEpIr3Pn87LTYSatM=' 
WHERE 
  key_id = 'fa9d5318be24fdbf9eeda4f8ef55c1e840a26cf52560de1c9021f708c23b35bd' 
  AND (
    token = 'GFFuFAvOwAHFpu9phSM51Jqld4uEpIr3Pn87LTYSatM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039