UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SrWsnl+UvXTpQ8LIEjMnvha55OCoDK45rTBtA36FDR4=' 
WHERE 
  key_id = '35c2ec51b84ea611e0055b943c8202e0c314101a4853ab14487752a5f6cc24de' 
  AND (
    token = 'SrWsnl+UvXTpQ8LIEjMnvha55OCoDK45rTBtA36FDR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021