UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANZQ2eINlArOFonLrapup/imsmeTzOfDO7HXkXvkpPc=' 
WHERE 
  key_id = '9c9f953b5b8da1657dd3d100c436305b9d1d8b8171687c13cb8ed10e826ed33f' 
  AND (
    token = 'ANZQ2eINlArOFonLrapup/imsmeTzOfDO7HXkXvkpPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028