UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4ctdO29dPZmCHk+ekxYFolLr8cm+GmsGzP58epm6oU=' 
WHERE 
  key_id = '08c9ec0545b57c657fc20a3b2594f853033e87e11062fa17ff2c1e4a2684a3ee' 
  AND (
    token = 'G4ctdO29dPZmCHk+ekxYFolLr8cm+GmsGzP58epm6oU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013